class Audience < ActiveRecord::Base
  attr_accessible :Address, :BirthDate, :EmailAddress, :FirstName, :LastName, :MidName, :Password, :Password_confirmation, :RecieveEmail, :UserName
  validates :UserName, :presence => true, :uniqueness => true
  validates :EmailAddress, :presence => true, :uniqueness => true
  
def self.search(search)
  if search
    find(:all, :conditions => ['UserName LIKE ?', "%#{search}%"])
  else
    find(:all)
  end
end

end